import cv2

img = cv2.imread('dog.jpg',flags=cv2.IMREAD_UNCHANGED)
cv2.imshow('image',img)

#修改一个区域像素
img[100:150,100:150]=[0,0,255]
cv2.imshow("newimage",img)#新图
cv2.waitKey(0)
cv2.destroyAllWindows()


